package com.cloud.schedule.common.dynamic;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class DataSourceUtils {
	public static final String DEFAULT = "default";

	private static final Map<String, String> dataSourceMap = new ConcurrentHashMap<>();

	public static void put(String projectId, String dataSource) {
		dataSourceMap.put(projectId, dataSource);
	}

	public static boolean contains(String projectId) {
		return dataSourceMap.get(projectId) != null;
	}

	public static String getDataSourceId(String projectId) {
		return dataSourceMap.get(projectId);
	}
}
